<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Good extends Model
{
    //
    protected $fillable = ['id','good_category_id','goods_sn','goods_name','market_price','img','shop_price','goods_content','is_rec','is_new','is_hot'];

    public function category(){
        return $this->hasOne('App\Models\GoodCategory','id','good_category_id');
    }

    public function user(){
        return $this->belongsToMany('App\User','saidans','good_id','user_id');
    }
}
